<template>
  <div id="app">
    <div id="tou">
      <table id="daohang">
        <tr>
          <th><router-link to="/">首页</router-link></th>
          <th><router-link to="/shopping">购物</router-link></th>
          <th><router-link to="/shopping_cart">购物车</router-link></th>
          <th><router-link to="/user/my_orders">个人中心</router-link></th>
        </tr>
      </table>
    </div>
    <div id="neirong">
      <router-view />
    </div>
  </div>
</template>

<script>


export default {
  name: 'App',
  data(){
    return{
      session_id:''
    }
    
  },
  components: {
    // HelloWorld
  },
  methods:{
    checkLogin(){
      this.$http.post('session_auth.php',{'session_id':this.session_id}).then(res=>{

        if(res.data.status===1){
          this.$store.commit('user/setUser',res.data);
        }
      })
    }
  },
  created(){
    this.session_id=this.$auth.getAuthorization();
    this.checkLogin();
  }
}
</script>

<style lang="scss" scoped>
#app {
  width: 70%;
  margin: auto;
  margin-top: 0px;
  border: 1px solid rgb(0, 255, 98);
  overflow: hidden;

  #tou {
    width: 99%;
    margin: 2px auto;
    border: 1px solid red;
    

    #daohang {
      width: 100%;
      // border: 1px solid black;
      border-collapse: collapse;
      // position: fixed;
      th {
        // border: 1px solid black;
        font-size: 40px;
        height: 60px;
        padding-top: 15px;

        a {
          color: pink;
          text-decoration: none;
        }

        a:hover {
          /* 鼠标移到链接上 */
          color: #0bc2d6;
          // text-decoration: underline;
        }

        a:active {
          /* 正在点击的链接 */
          color: #03031f;
          // text-decoration: underline;
        }
      }
    }
  }

  #neirong {
    width: 99%;
    margin: 2px auto;
    border: 1px solid rgb(228, 23, 176);
  }





}</style>
